package br.ucb.rest.persistencia.vo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="rst_fila_chamado")
@SequenceGenerator(name="FilaChamadoVO.seq", sequenceName="restaurante.rst_fila_chamado_nu_fila_seq")
@NamedQueries({
	@NamedQuery(name="FilaChamadoVO.recuperarAbertos", 
		query="SELECT a FROM FilaChamadoVO a " +
			"WHERE a.inAtendido = false " +
			"ORDER BY a.dtChamado ")
})
public class FilaChamadoVO implements Serializable {
	private static final long serialVersionUID = 6339457067266001911L;

	@Id
	@Column(name="nu_fila")
	@GeneratedValue(generator="FilaChamadoVO.seq", strategy=GenerationType.AUTO)
	private Integer nuFila;

	@JoinColumn(name="nu_mesa", nullable=false)
	@ManyToOne(fetch=FetchType.EAGER)
	private MesaVO mesaVO;

	@JoinColumn(name="nu_garcom", referencedColumnName="nu_garcom")
	@ManyToOne(fetch=FetchType.EAGER, optional=true)
	private GarcomVO garcomVO;
	@Column(name="dt_chamado")
	@Temporal(TemporalType.TIMESTAMP)
	private Date dtChamado;
	@Column(name="in_atendido")
	private Boolean inAtendido;
	@Column(name="tx_motivo")
	private String txMotivo;
	
	public Integer getNuFila() {
		return nuFila;
	}
	public void setNuFila(Integer nuFila) {
		this.nuFila = nuFila;
	}
	public GarcomVO getGarcomVO() {
		return garcomVO;
	}
	public void setGarcomVO(GarcomVO garcomVO) {
		this.garcomVO = garcomVO;
	}
	public Date getDtChamado() {
		return dtChamado;
	}
	public void setDtChamado(Date dtChamado) {
		this.dtChamado = dtChamado;
	}
	public Boolean getInAtendido() {
		return inAtendido;
	}
	public void setInAtendido(Boolean inAtendido) {
		this.inAtendido = inAtendido;
	}
	public MesaVO getMesaVO() {
		return mesaVO;
	}
	public void setMesaVO(MesaVO mesaVO) {
		this.mesaVO = mesaVO;
	}
	public String getTxMotivo() {
		return txMotivo;
	}
	public void setTxMotivo(String txMotivo) {
		this.txMotivo = txMotivo;
	}

	
}
